package com.ziyueyuwen.xiniao.service;

import com.ziyueyuwen.xiniao.bean.page.PageData;
import com.ziyueyuwen.xiniao.bean.query.QuestionQuery;
import com.ziyueyuwen.xiniao.bean.question.ZyQuestionData;
import com.ziyueyuwen.xiniao.bean.vo.ZyQuestionDataVO;

import java.util.Set;

/**
 * @author wancheng  on 2019/1/10.
 */
public interface QuestionDataService {
    /**
     * 添加
     * @param data
     * @return 主键
     */
    ZyQuestionDataVO insert(ZyQuestionData data);

    /**
     * 知识点 题目保存
     * @param data
     * @param points
     * @return
     */
    ZyQuestionData insert(ZyQuestionData data, Set<Integer> points);

    /**
     * 添加题型,并且关联题与课节
     * @param data
     * @param points
     * @param courseId
     * @param lessonIndex
     * @return
     * @throws Exception
     */
    ZyQuestionDataVO insert(ZyQuestionData data, Set<Integer> points, Integer courseId, Integer lessonIndex,Integer questionGroup, String answerOrder) throws Exception;

    /**
     *主键修改
     * @param data
     * @return
     */
    ZyQuestionDataVO updateByPrimaryKey(ZyQuestionData data);

    /**
     * 知识点 题目修改
     * @param data
     * @param points
     * @return
     */
    ZyQuestionDataVO updateByPrimaryKey(ZyQuestionData data, Set<Integer> points);

    /**
     * 修改题型,顺便修改套题中的题型
     * @param data
     * @param points
     * @return
     */
    ZyQuestionDataVO updateSyncCourse(ZyQuestionData data, Set<Integer> points, Integer courseId, Integer lessonIndex, String answerOrder) throws Exception;

    /**
     * 主键删除
     * @param id
     */
    void deleteByPrimaryKey(Integer id);

    /**
     * 主键 获取
     * @param id
     * @return
     */
    ZyQuestionDataVO getByPrimaryKey(Integer id);

    /**
     * 分页查询题型
     * @param query
     * @return
     */
    PageData getQuestion(QuestionQuery query);
}
